Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Battery Manager] - New Module #4221

Merged
merged 16 commits into from
Feb 13, 2020

Conversation

HenriRabalais
Copy link
Collaborator

@HenriRabalais HenriRabalais commented Dec 20, 2018

Summary of Functions

This is the Battery Manager Module. It manages test batteries. It was original made by @victoriafoing. Since leaving, I have maintained and refactored the code to meet new standards, while keeping the same functionality:

  • Tests can be viewed and filtered via the Menu Filter.
  • Tests can be added via the Add Test button and form. Every new test is given a status of 'Active' === 'Y'
  • Tests can be activated and deactivated via the Activate and Deactivate buttons.
  • Tests can be "Edited" via the Edit button and form. This is not true editing, since every edit creates a new test in the database. This also causes the previous test to be deactivated.
  • Duplicates of "Active" Tests are not permitted. However, when a user attempts to create a duplicate of a inactive test, they are given the option to activate it.

Features

  • Includes new React Menu Filter Template.
  • Includes Real LORIS endpoints and no ajax scripts.
  • Uses the dataframework.

@HenriRabalais HenriRabalais added Category: Feature PR or issue that aims to introduce a new feature [branch] major labels Dec 20, 2018
@driusan
Copy link
Collaborator

driusan commented Dec 21, 2018

Not sure how since nothing was merged since this PR was sent yesterday, but this already has conflicts

Copy link
Collaborator

@driusan driusan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass at reviewing

jsx/Filter.js Outdated Show resolved Hide resolved
jsx/Filter.js Outdated Show resolved Hide resolved
jsx/Form.js Outdated Show resolved Hide resolved
modules/battery_manager/README.md Outdated Show resolved Hide resolved
modules/battery_manager/README.md Show resolved Hide resolved
modules/battery_manager/php/battery_manager.class.inc Outdated Show resolved Hide resolved
modules/battery_manager/php/battery_manager.class.inc Outdated Show resolved Hide resolved
modules/battery_manager/php/test.class.inc Show resolved Hide resolved
modules/battery_manager/php/battery_manager.class.inc Outdated Show resolved Hide resolved
modules/battery_manager/php/testprovisioner.class.inc Outdated Show resolved Hide resolved
@HenriRabalais HenriRabalais force-pushed the battery_manager_2018_10_16 branch from 770c1b8 to 5589429 Compare December 21, 2018 19:18
@johnsaigle johnsaigle added the State: Needs work PR awaiting additional work by the author to proceed label Jan 2, 2019
jsx/Form.js Outdated Show resolved Hide resolved
@johnsaigle johnsaigle added the State: Discussion required PR or issue that requires the resolution of a discussion with the relevant parties to proceed label Jan 4, 2019
jsx/Modal.js Outdated Show resolved Hide resolved
modules/battery_manager/README.md Outdated Show resolved Hide resolved
modules/battery_manager/README.md Outdated Show resolved Hide resolved
modules/battery_manager/README.md Outdated Show resolved Hide resolved
modules/battery_manager/README.md Outdated Show resolved Hide resolved
modules/battery_manager/README.md Outdated Show resolved Hide resolved
modules/battery_manager/help/battery_manager.md Outdated Show resolved Hide resolved
modules/battery_manager/php/battery_manager.class.inc Outdated Show resolved Hide resolved
modules/battery_manager/php/testprovisioner.class.inc Outdated Show resolved Hide resolved
modules/battery_manager/test/TestPlan.md Outdated Show resolved Hide resolved
@HenriRabalais
Copy link
Collaborator Author

@PapillonMcGill Addressed!

@PapillonMcGill
Copy link
Contributor

LGTM

@johnsaigle
Copy link
Contributor

@HenriRabalais I did a PHPCS for you

@HenriRabalais HenriRabalais force-pushed the battery_manager_2018_10_16 branch from 47a8dae to 0a21444 Compare January 15, 2019 22:10
@johnsaigle
Copy link
Contributor

modules/battery_manager/php/battery_manager.class.inc needs PHPCS

@HenriRabalais HenriRabalais force-pushed the battery_manager_2018_10_16 branch from a5811c8 to 8c30756 Compare January 17, 2019 20:42
LEFT JOIN test_names t USING (Test_name)
LEFT JOIN subproject s USING (SubprojectID)
LEFT JOIN psc p USING (CenterID)
ORDER BY t.Full_name",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why, but this doesn't seem to be working. Every time the query is made, the rows appear in a different order.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HenriRabalais Have you tried sorting by a column that is part of the result rows? ex: testName

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll give it a try

@@ -0,0 +1,54 @@
# Battery Manager
*For Rida: Add what each value in the test_battery does and what happens if it's left empty*
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HenriRabalais HenriRabalais removed State: Discussion required PR or issue that requires the resolution of a discussion with the relevant parties to proceed State: Needs work PR awaiting additional work by the author to proceed labels Jan 17, 2019
jsx/FilterableDataTable.js Show resolved Hide resolved
modules/battery_manager/js/batteryManagerIndex.js Outdated Show resolved Hide resolved
modules/battery_manager/js/editEntry.js Outdated Show resolved Hide resolved
jsx/DataTable.js Outdated Show resolved Hide resolved
@HenriRabalais HenriRabalais added the "Help! I don't understand Travis!" PR is having a beef with TRAVIS. Someone needs to help label Jan 25, 2019
@PapillonMcGill
Copy link
Contributor

restarted Travis as error doesn't seem to make sense with change

@johnsaigle
Copy link
Contributor

Needs PHPCS

FILE: .../aces/Loris/modules/battery_manager/php/testcontroller.class.inc
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 91 | WARNING | Line exceeds 85 characters; contains 86 characters
----------------------------------------------------------------------

@ridz1208 ridz1208 added the State: Needs work PR awaiting additional work by the author to proceed label Jan 30, 2020
@HenriRabalais HenriRabalais removed the State: Needs work PR awaiting additional work by the author to proceed label Feb 4, 2020
@HenriRabalais
Copy link
Collaborator Author

@ridz1208 should be fixed.

@HenriRabalais HenriRabalais force-pushed the battery_manager_2018_10_16 branch from f6849b8 to dcc02e8 Compare February 4, 2020 20:11
made sure everything is functional

minor format change

fixed error in code

reverted Modal form to original state

fixed user perm rel file
@HenriRabalais HenriRabalais force-pushed the battery_manager_2018_10_16 branch from dcc02e8 to 5165a39 Compare February 4, 2020 20:14
@ridz1208
Copy link
Collaborator

ridz1208 commented Feb 6, 2020

Testing results:

  1. When entering a new test, 4 fields are required but only 2 of them have the red star next to the field name (see images)
    Screenshot from 2020-02-06 15-05-58
    Screenshot from 2020-02-06 15-06-08
  2. Required fields do not have validation on the JS side, it's only on submission that they are validated backend.
  3. if you try editing an entry, don't change anything and hit submit. You get an error message, test duplicate... it should not give an error if you click edit and don't change anything
  4. Getting a test duplicate error when test is not duplicated (see images below)
    Screenshot from 2020-02-06 15-22-48
    Screenshot from 2020-02-06 15-23-02
    Screenshot from 2020-02-06 15-23-15
  5. activate/deactivate is not working (when you click it it works but no change in the database)
  6. Instrument_order field should not be taken into consideration when checking for duplicate (ie if all the rest of the fields are the same but the order is different, it's still a conflict)
  7. the min/max age and instrument order filters behave as textual search not integer matching (not sure if that is fixable)
  8. change status and edit metadata appear in the downloaded CSV data (it doesnt make sens in the CSV to be there)

@ridz1208
Copy link
Collaborator

    ERROR in ./modules/battery_manager/jsx/batteryManagerIndex.js
    Module Error (from ./node_modules/eslint-loader/index.js):
    
    /var/www/loris/modules/battery_manager/jsx/batteryManagerIndex.js
      255:1  warning  Line 255 exceeds the maximum line length of 80  max-len
      453:3  error    Missing JSDoc for parameter 'test'              valid-jsdoc
    
    ✖ 2 problems (1 error, 1 warning)

@ridz1208 ridz1208 added Passed manual tests PR has been successfully tested by at least one peer Release: Add to release notes PR whose changes should be highlighted in the release notes labels Feb 12, 2020
Copy link
Collaborator

@driusan driusan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some minor problems but I don't think they're blockers, and they can be addressed later.

window.addEventListener('load', () => {
ReactDOM.render(
<BatteryManagerIndex
testEndpoint={`${loris.BaseURL}/battery_manager/testendpoint/`}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand why these URLs have "endpoint" in the name

@@ -0,0 +1,117 @@
# Battery Manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to follow the style guidelines in docs/HelpStyleGuide.md

@driusan driusan merged commit f3ccb31 into aces:master Feb 13, 2020
@ridz1208 ridz1208 added this to the 23.0.0 milestone Feb 25, 2020
@HenriRabalais HenriRabalais deleted the battery_manager_2018_10_16 branch May 7, 2020 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Feature PR or issue that aims to introduce a new feature Passed manual tests PR has been successfully tested by at least one peer Release: Add to release notes PR whose changes should be highlighted in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants